package com.jlpay.openapi.demo.openmerch.query;

import com.jlpay.open.jlpay.sdk.java.model.openmerch.query.request.MerchMasterSettCardQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.openmerch.query.response.MerchMasterSettCardQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 商户主结算卡信息查询
 * @author chenjunhong
 * @date 2024/4/15
 */
public class MerchMasterSettCardQueryService {
    private static final Logger LOGGER = LoggerFactory.getLogger(MerchMasterSettCardQueryService.class);

    public static void main(String[] args) {
        MerchMasterSettCardQueryRequest merchMasterSettCardQueryRequest = buildMerchMasterSettCardQueryRequest();
        MerchMasterSettCardQueryResponse merchMasterSettCardQueryResponse = JlpayOpenApiService.openMerchWithCryptoService()
                .post(merchMasterSettCardQueryRequest, MerchMasterSettCardQueryResponse.class);
        LOGGER.info("商户主结算卡信息查询响应:{}", JsonUtils.toString(merchMasterSettCardQueryResponse));
    }

    private static MerchMasterSettCardQueryRequest buildMerchMasterSettCardQueryRequest() {
        MerchMasterSettCardQueryRequest merchMasterSettCardQueryRequest = new MerchMasterSettCardQueryRequest();
        // 商户号
        merchMasterSettCardQueryRequest.setMerchNo("849584358140108");
        return merchMasterSettCardQueryRequest;
    }
}
